﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace P2PLib.Common.Command
{
    public class CommandUtils
    {
        /// <summary>
        /// fill the dest with source's bytes ,start from index
        /// </summary>
        /// <param name="source"></param>
        /// <param name="dest"></param>
        /// <param name="index"></param>
        public static void CopyByteFrom(byte[] source, byte[] dest,int index)
        {
            for (int i = index; i < dest.Length; i++)
            {
                dest[i - index] = source[i];
            }
        }

        public static void CopyByteTo(byte[] source, byte[] dest, int index)
        {
            for (int i = 0; i < source.Length; i++)
            {
                dest[index + i] = source[i];
            }
        }
    }
}
